<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/pages/templates/commonLayoutCli.xhtml">

	<ui:define name="content">

		<h:form>

			<center>
					<p:growl id="messages" showDetail="true" />

				<p:panel style="width:70%">
					<h:panelGrid id="panelSchedule" columnClasses="value">
						<h3 style="margin-top: 0">Horários Disponíveis</h3>
						<p:schedule id="schedule" value="#{beanVisualizarHorarios.eventModel}"
							widgetVar="myschedule" rightHeaderTemplate="" draggable="false"
							locale="tr">
							<p:ajax event="eventSelect"
								listener="#{beanVisualizarHorarios.onEventSelect}" update="eventDetails"
								oncomplete="eventDialog.show()" />

						</p:schedule>
					</h:panelGrid>
				</p:panel>

					<p:dialog widgetVar="eventDialog" header="Informações do Horário"
						showEffect="clip" hideEffect="clip" minHeight="10">
						<p:scrollPanel mode="native" style="height:200px;width:500px">

							<h:panelGrid id="eventDetails" columns="2" cellpadding="5"
								style="width:60%;align:center;valign:middle;">
								
								<p:outputLabel for="prof" value="Profissional:"></p:outputLabel>
								<p:inputText id="prof" readonly="true"  value="#{beanVisualizarHorarios.horario.profissional.nome}"></p:inputText>
								<p:outputLabel for="data" value="Data:"></p:outputLabel>
								<p:inputText id="data" readonly="true"  value="#{beanVisualizarHorarios.data}"></p:inputText>
								<p:outputLabel for="hora" value="Hora:"></p:outputLabel>
								<p:inputText id="hora" readonly="true" value="#{beanVisualizarHorarios.hora}"></p:inputText>
								<p:outputLabel for="vagas" value="Vagas:"></p:outputLabel>
								<p:spinner id="vagas" readonly="#{beanVisualizarHorarios.edicaoDesabilitada}" value="#{beanVisualizarHorarios.horario.numeroVagas}"  min="0" max="100" size="10"/>
								
								<h:panelGrid id="eventDetails2" columns="2" cellpadding="1"
									style="width:10%;align:center;valign:middle;">
			
									<p:commandButton value="Editar"  disabled="#{beanVisualizarHorarios.edicaoDesabilitada}" action="#{beanVisualizarHorarios.editaHorario()}" update="schedule" oncomplete="eventDialog.hide();"/>
									<p:commandButton value="Deletar" action="#{beanVisualizarHorarios.deletaHorario()}" update="schedule" oncomplete="eventDialog.hide();"/>
								</h:panelGrid>
							
							</h:panelGrid>
							

						</p:scrollPanel>
					</p:dialog>
			</center>
			
			<script type="text/javascript">
		PrimeFaces.locales['tr'] = {
			currentText : 'Atual',
			monthNames : [ 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
					'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
					'Novembro', 'Dezembro' ],
			monthNamesShort : [ 'Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
					'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez' ],
			dayNames : [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta',
					'Sexta', 'Sabado' ],
			dayNamesShort : [ 'Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab' ],
			dayNamesMin : [ 'Do', 'Se', 'Te', 'Qa', 'Qi', 'Se', 'Sa' ],
			weekHeader : 'Hf',
			dayHeader : false,
			firstDay : 1,
			isRTL : false,
			showMonthAfterYear : false,
			yearSuffix : '',
			month : 'Mês',
			week : 'Semana',
			day : 'Dia',
			allDayText : 'Todos'
			
			
		};
		
	</script>

			<style type="text/css">
				.value {
					width: 1000px;
				}
			</style>
		
		</h:form>
	</ui:define>

	
</ui:composition>


</html>